package com.yn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum DoctorTypeEnum {

    CONSULTING("1", "坐诊"),
    INPATIENT("2", "住院");

    private String code;
    private String name;

    public static DoctorTypeEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        for (DoctorTypeEnum type : DoctorTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}